Your Turn: heart.csv
- Is there a difference in cholesterol level between females and
males?
- Optional: use heart_missing.csv and only exclude those with NA for sex and chol (don’t
use na.omit())
- Optional: stratify by smoking status
- Challenge (optional): think about how you would determine if there is a difference in sex
distribution (number of males vs females) for people with cholsterol < 240 vs cholsterol
>= 240?
Hint:
- .test(x = sample, alternative = "two.sided" or “greater” or “less”)
- t.test(x = sample1, y = sample2, alternative = "two.sided" or “greater” or “less”, var.equal
= TRUE or FALSE)
- t.test(x = sample1, y = sample2, alternative = "two.sided" or “greater” or “less”, paired =
TRUE, var.equal = TRUE or FALSE)